package ee.helmesWorkTest.frontend.controller.eventfinder;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;


public class PersonSectorEventFinder implements EventFinder
{
	private Logger logger = Logger.getLogger(PersonSectorEventFinder.class);
	
	@Override
	public String findEvent(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException 
	{
		String event = "insertPersonSectorInvolvementPage";
		
		try 
		{
			String formSubmitted = request.getParameter("formSubmitted");
			
			if (formSubmitted != null && formSubmitted.equals("insertPersonSectorInvolvementForm"))
			{
				event = "insertPersonSectorInvolvementFormPostEvent";
			}
		}
		catch (Exception e) 
		{
			e.printStackTrace();
			logger.error(e.getMessage());
		}
		
		return event;
	}
}
